from pylab import *

T1 = []
T2 = []
T3 = []

for i in range(1,101):
	w = loadtxt('EoS/eos_'+str(i)+'.txt')
	n1 = sum( abs((w[:,0]+1)/w[:,1]) >= 1.0 )
	T1.append(n1)

	n2 = 0
	n3 = 0
	for j in range(len(w[:,0])):
		if (w[j,0] > -1) and (w[j,2] > -1): n2 += 1
		if (w[j,0] < -1) and (w[j,3] < -1): n2 += 1
		if (w[j,0] > -1) and (w[j,4] > -1): n3 += 1
		if (w[j,0] < -1) and (w[j,5] < -1): n3 += 1
	# print '%3d wi deviates from w=-1 more than 1-sigma!'%(n)
	T2.append(n2)
	T3.append(n3)

T1 = array(T1)
T2 = array(T2)
T3 = array(T3)

print 'T1: ', sum(T1>0)
print 'T2: ', sum(T2>0)
print 'T3: ', sum(T3>0)


# plot(T,'o')

# show()
